<extend name="Base:base" />
<block name="head">
    <script type="text/javascript" charset="utf-8" src="__PUBLIC__/js/jquery-ui-1.10.4.custom.js"></script>
    <link rel="stylesheet" type="text/css" href="__PUBLIC__/css/jquery-ui-1.10.4.custom.css" />
</block>
<block name="title">{$title}</block>
<block name="content">
    <a href="{:U('Admin/Category/add')}" class="add">添加产品类别</a>
    <div id="content">
        <table class="table">
            <tr>
                <th>id</th>
                <th>类别名称</th>
                <th>是否显示</th>
                <th>排序</th>
                <th>操作</th>
            </tr>
            <foreach name="categories" item="category">
                <tr>
                        <td>[<a href="{:U('Admin/Category/view',array('id'=>$category['id']))}">{$category.id}]</a></td>
                        <td>{$category.name}</td>
                        <td>
                            <if condition="$category.is_active eq 1">
                            显示
                            <else/>
                            不显示
                            </if>
                        </td>
                        <td>{$category.sort_order}</td>  
                        <td>【<a href="{:U('Admin/Category/view',array('id'=>$category['id']))}">查看</a>】
                        【<a href="{:U('Admin/Category/edit',array('id'=>$category['id']))}">修改</a>】
                        【<a onclick="return confirm('确认要删除产品类别,并会删除所有该类别下的所有数据？');" href="{:U('Admin/Category/delete',array('id'=>$category['id']))}">删除</a>】
                        </td>
                </tr>
            </foreach>
        </table>
        <div class="digg">{$page}</div>
    </div>
</block>